home *** CD-ROM | disk | FTP | other *** search
- Path: news.cloud9.net!usenet
- From: jalvo@cloud9.net (John G. Alvord)
- Newsgroups: comp.lang.c,comp.lang.c++,comp.lang.std.c,com[p.lang.std.c++
- Subject: preprocessing question
- Date: Tue, 05 Mar 1996 02:07:10 GMT
- Organization: Bet Your Business Technologies
- Message-ID: <313b9e9f.480978@NEWS.CLOUD9.NET>
- NNTP-Posting-Host: jalvo.dialup.cloud9.net
- X-Newsreader: Forte Agent .99d/16.182
-
- I have a couple compilers argument about the following problem:
-
- #define XXX (1)
- #include <stdio.h>
- int main(void)
- {
- #if XXX
- printf("Hello World!");
- #endif
- return 0;
- }
-
- most compilers I have tried preprocess the #if resulting in "#if (1)" and then
- follow that instruction to generate the printf() call.
-
- One compiler (SAS/C 5.50 cross compiler on AIX for MVS) complains that the #if
- line is an illegal constant. A close reading of the ANSI C standard document
- reveals a clause that seems to imply (my reading) that a pre-processed series
- of tokens that appear to be a preprocessing statement will be ignored. A
- coworker who is more experienced then me feels that the #if does not fall
- under that clause and the #if will be evaluated. His reasoning is that the
- preprocessed series of tokens is just a part of a preprocessing statement.
-
- If someone can shed some light on this, he would make me very happy.
-
- Thanks!
-
- John Alvord
-